package com.gzit.dialog;

import android.app.Activity;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface.OnClickListener;

public class DialogUtils {

	public static void confirm(Activity ctx, String title, String msg,
			String okLabel, String cancelLabel, OnClickListener listener) {

		Builder builder = new AlertDialog.Builder(ctx);
		builder.setPositiveButton(okLabel, listener);
		builder.setNegativeButton(cancelLabel, null);
		builder.setTitle(title);
		builder.setMessage(msg);
		AlertDialog dialog = builder.create();
		dialog.show();

	}

	public static ProgressDialog getProgressDlg(Context context, String msg) {
		ProgressDialog progressDlg = new ProgressDialog(context);
		progressDlg.setMessage(msg);
		progressDlg.setIndeterminate(true);
		progressDlg.setCancelable(false);
		return progressDlg;
	}

}
